<template>
  <div>
    <h2>我是姐姐,我开的是{{car}}</h2>
    <button @click="changeCar">找了男朋友,哥哥给我换了车车</button>
  </div>
</template>

<script>

import PubSub from "pubsub-js";
export default {
  name: "Jie",
  data() {
    return {
      car:"mini"
    }
  },
    methods:{
      changeCar(){
        this.car = "劳斯莱斯幻影"
        PubSub.publish("getCar",this.car)
      },
     
    }
};
</script>

<style>

</style>
